<?php
	##########
	# Administrador de SMS
	# sistema:	eCRM
	# autor: 	rgutierrez
	# fecha: 	21/04/2006
	# ultima modif: 21/04/2006 (rgutierrez)
	# descripcion:  
	##########

  
   require("../../configuracion.php");
   $idSysSection = $sectionCampSMS;
   $path = "../../";
   require("../../application-top.php");


    $query = " select count(*) as enviados ";
    $query .= " from tbl_CampaniasSMS ";
    $query .= " where (tbl_CampaniasSMS.id_TipoCampania = '1' AND tbl_CampaniasSMS.id_StatusCampania > 2 )";
    $result = mssql_query ($query);
    $row = mssql_fetch_object($result);
    $enviados = $row->enviados;


     $query = " select count(*) as porenviar ";
     $query .= " from tbl_CampaniasSMS ";
     $query .= " where (tbl_CampaniasSMS.id_TipoCampania = '1' AND tbl_CampaniasSMS.id_StatusCampania < 3 )";
     

     $result = mssql_query ($query);
     $row = mssql_fetch_object($result);
     $porenviar = $row->porenviar;


     $query = " select count(*) as programado ";
     $query .=" from tbl_CampaniasSMS ";
     $query .=" INNER JOIN tbl_CampaniasSMSProgramacion ON ";
     $query .=" tbl_CampaniasSMS.id_CampaniaSMS = ";
     $query .=" tbl_CampaniasSMSProgramacion.id_CampaniaSMS ";
     $query .=" where (tbl_CampaniasSMS.id_TipoCampania = 2) ";
     $result = mssql_query ($query);
     $row = mssql_fetch_object($result);
     $programado = $row->programado;

?>


<html>
<head>
  <title><?= $instanciaECRM ?></title>
  <link rel="stylesheet" href="../../styles/style.css" type="text/css">
</head>
<body leftmargin="0" class="mainBackground" topmargin="0" marginwidth="0" marginheight="0">
<table width="100" border="0" cellpadding="0" cellspacing="0">
  <tr><td><img src="../../images/headerBar.gif" width="590" height="60" alt=""></td></tr>
  <tr>
    <td><table width="800" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td bgcolor="#FFFFFF" valign="top" height="400">
<table border="0" cellpadding="5" cellspacing="0" width="750">
  <tr><td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr><td colspan="2"><img src="images/spacer.gif" height="10" width="1" alt=""></td></tr><tr><td><strong class="pageTitle">Campa&ntilde;as SMS</strong></td><td align="right"><a href="http://www.cacto.com/" target="_blank"><img src="../../images/trademarkCacto.gif" alt="Cacto" border="0"></a><br>
<strong class="systemTitle"><?= $instanciaECRM ?></strong><br>Perfil <strong><?= $PerfilUsuario ?></strong></td></tr>
  </table></td></tr>
   <tr><td colspan="2">
        <table border="0" cellpadding="5" cellspacing="1" class="mainTableBG">
          <tr class="answerCellBG">
            <td><img src="../../images/icArrowGo.gif" height="13" width="13" alt=""></td>
            <td><a href="../campanias_admin.php" target="content">Regresar</a></td>
          </tr>
        </table>
      </td></tr>
  <tr><td>
    <table border="0" cellpadding="5" cellspacing="1" class="mainTableBG">
      <tr class="answerCellBG">
        <td><img src="../../images/icArrowGo.gif" height="13" width="13" alt=""></td>
        <td><a href="sms_enviados.php" target="content">Enviadas</a></td>
        <td><img src="../../images/icArrowGo.gif" height="13" width="13" alt=""></td>
        <td><a href="sms_programado.php" target="content">Programaci&oacute;n autom&aacute;tica</a></td>
        <td><img src="../../images/icArrowGo.gif" height="13" width="13" alt=""></td>
        <td><a href="sms_porenviar.php" target="content">Por enviar</a></td>
        <td><img src="../../images/icArrowGo.gif" height="13" width="13" alt=""></td>
        <td><a href="sms_crearcampania.php" target="content">Crear nueva campa&ntilde;a</a></td>
      </tr>
    </table>
  </td></tr>
  <tr>
  <td valign="top" width="100%">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr><td>
        <table border="0" cellpadding="5" cellspacing="1" width="100%" class="secTableBG">
          <tr>
            <td width="25%" class="secTableTitle"><strong>Tipo&nbsp;de&nbsp;SMS</strong></td>
            <td width="55%" class="secTableTitle"><strong>Descripci&oacute;n</strong></td>
            <td width="20%" class="secTableTitle"><strong>Total&nbsp;Campa&ntilde;as</strong></td>
          </tr>
          <tr class="conceptCellBG">
            <td><a href="sms_enviados.php" target="content">Enviadas</a></td>
            <td>Campa&ntilde;as &uacute;nicas (no repetitivas o programadas) que ya fueron enviadas.</td>
            <td align="center"><?= $enviados ?></td>
          </tr>
          <tr class="answerCellBG">
            <td><a href="sms_programado.php" target="content">Programaci&oacute;n autom&aacute;tica</a></td>
            <td>Campa&ntilde;as repetitivas o programadas, incluye las programadas sin enviar y las ya enviadas.</td>
            <td align="center"><?= $programado ?></td>
          </tr>
          <tr class="conceptCellBG">
            <td><a href="sms_porenviar.php" target="content">Por enviar</a></td>
            <td>Campa&ntilde;as no enviadas y en espera de revisi&oacute;n, autorizaci&oacute;n o ejecuci&oacute;n.</td>
            <td align="center"><?= $porenviar ?></td>
          </tr>
          <tr class="answerCellBG">
            <td><a href="sms_crearcampania.php" target="content">Crear nueva campa&ntilde;a</a></td>
            <td>Crear una nueva campa&ntilde;a, ya sea &uacute;nica o repetitiva programada.</td>
            <td colspan="2">&nbsp;</td>
          </tr>
    
        </table>
      </td></tr>
    </table>
  </td>
  </tr>
</table>
          </td>  
        </tr>
      </table></td>
  </tr>
</table>
</form>
<br>
<br>
<br>
<table width="750" border="0" cellpadding="5" cellspacing="0">
  <tr>
    <td align="right"><span class="copyright"><?= $copyright ?></span></td>
  </tr>
</table>
</body></html>
